<!DOCTYPE html>
<html>
<head>
</head>
<body>
<script>
    window.addEventListener('beforeunload', function() {
        return 'something';
    });
</script>
</body>
</html>
